#include<bits/stdc++.h>
using namespace std;
int main(){
freopen("duel.in","r",stdin);
freopen("duel.out","w",stdout);
int a;
cin>>a;
int n[a],be=0;
for(int i=1;i<=a;i++)cin>>n[i-1];
sort(n,n+a);
for(int i=1;i<=a;i++)if(n[i-1]>n[be])be++;
cout<<a-be;
return 0;
}
